using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace SqlRunner
{
    public partial class frmServerSearch : Form
    {
       
        public frmServerSearch()
        {
            InitializeComponent();
        }

        public frmServerSearch(List<string> servers):this()
        {            
            lstServers.Items.Clear();
            lstServers.Items.AddRange(servers.ToArray());
        }

        private string _server;
        public string Server
        {
            get { return _server; }
        }

        private void bntOK_Click(object sender, EventArgs e)
        {
            if (lstServers.SelectedItem == null) return;
            DialogResult = DialogResult.OK;
            _server = lstServers.SelectedItem.ToString();
        }

    }
}